﻿using System;
using System.Collections.Generic;
using System.Text;
using TSVNAddin.SVN;

namespace TSVNAddin.Core
{
	public class WorkingCopy
	{
		private string _WorkingRoot;
		private readonly string _SolutionFileName;
		private readonly bool _Enabled;

		public WorkingCopy(string workingRoot, string solutionFileName, bool enabled)
		{
			_WorkingRoot = workingRoot;
			_SolutionFileName = solutionFileName;
			_Enabled = enabled;
		}

		public string WorkingRoot
		{
			get
			{
				return _WorkingRoot;
			}
			set
			{
				_WorkingRoot = value;
			}
		}

		public bool IsChanged(string solutionFileName)
		{
			return _SolutionFileName == solutionFileName;
		}

		public bool IsEnable()
		{
			return _Enabled;
		}

		public bool Contains(string fileName)
		{
			return fileName.ToLower().Contains(_WorkingRoot.ToLower());
		}
	}
}
